Modernize the xReply check
authorMatthias Clasen <mclasen@redhat.com>
Sat, 7 Mar 2015 23:25:57 +0000 (18:25 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 7 Mar 2015 23:25:57 +0000 (18:25 -0500)
Using AC_CHECK_TYPE instead of AC_TRY_COMPILE avoids compiler
warnings from -Werror.

https://bugzilla.gnome.org/show_bug.cgi?id=535929

configure.ac

index ccbd350b531766d2c49717f40148ed0c7aacfe18..6720d5296b7aa4873aea4fcf17f41ece5f4d18cb 100644 (file)
@@ -1031,22 +1031,16 @@ if test "x$enable_x11_backend" = xyes; then
   AC_CHECK_FUNC(XextFindDisplay, :,
                 AC_MSG_ERROR([*** libX11 and libXext not found. Check 'config.log' for more details.]))
 
-  # Check for xReply
-
-  AC_MSG_CHECKING([if <X11/extensions/XIproto.h> is needed for xReply])
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlibint.h>]],
-                                     [[xReply *rep = NULL;
-                                       rep = rep;]])],
-                    [AC_MSG_RESULT([no])],
-                    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/XIproto.h>
-                                                          #include <X11/Xlibint.h>]],
-                                                        [[xReply *rep = NULL;
-                                                          rep = rep;]])],
-                                       [AC_MSG_RESULT([yes])
-                                        AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], [1],
-                                                  [Define if <X11/extensions/XIproto.h> needed for xReply])],
-                                       [AC_MSG_RESULT([unknown])
-                                        AC_MSG_ERROR([xReply type unavailable. X11 is too old])])])
+  # Check if <X11/extensions/XIproto.h> is needed for xReply.
+
+  AC_CHECK_TYPE([xReply], ,
+                [AC_CHECK_TYPE([xReply],
+                               [AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], 1,
+                                          [Define if <X11/extensions/XIproto.h> needed for xReply])],
+                               [AC_MSG_ERROR([xReply type unavailable. X11 is too old])],
+                               [[#include <X11/extensions/XIproto.h>
+                                 #include <X11/Xlibint.h>]])],
+                [[#include <X11/Xlibint.h>]])
 
   # Check for XKB support.